package com.ctg.itrdc.sysmgr.portal.data.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.ctg.itrdc.pasp.core.PageInfo;
import com.ctg.itrdc.pasp.data.dao.BaseDao;
import com.ctg.itrdc.sysmgr.portal.data.ISystemPostDao;
import com.ctg.itrdc.sysmgr.portal.data.entity.SystemPost;
import com.ctg.itrdc.sysmgr.portal.data.vo.SystemPostVO;

@Component("systemPostDao")
public class SystemPostDaoImpl extends BaseDao<SystemPost, Long> implements
		ISystemPostDao {

	@Override
	public List<SystemPostVO> selectByUId(Long sysUserId) {
		Map<String, Object> model = new HashMap<String, Object>(1);
		model.put("userId", sysUserId);
		return queryBySqlId("selectByUId", SystemPostVO.class, model, null);
	}

	@Override
	public PageInfo<SystemPostVO> jdbcFindPageInfoByOrgId(SystemPost entity,
			Long sysUserId, Integer currentPage, Integer perPageNum) {
		Map<String, Object> model = new HashMap<String, Object>(2);
		model.put("sp", entity);
		model.put("sysUserId", sysUserId);
		return pageBySqlId("jdbcFindPageInfoByOrgId", SystemPostVO.class, currentPage, perPageNum, model, null);
	}

	@Override
	public PageInfo<SystemPostVO> jdbcFindPageInfoByRzOrgId(SystemPost entity,
			Long rzOrgId, Long sysUserId, Integer currentPage, Integer perPageNum) {
		Map<String, Object> model = new HashMap<String, Object>(3);
		model.put("sp", entity);
		model.put("sysUserId", sysUserId);
		model.put("rzOrgId", rzOrgId);
		return pageBySqlId("jdbcFindPageInfoByRzOrgId", SystemPostVO.class, currentPage, perPageNum, model, null);
	}

}